package com.yt.order.models.bo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.annotation.PostConstruct;
import java.io.Serializable;
import java.util.List;
import java.util.ArrayList;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import com.alibaba.fastjson.annotation.JSONField;

/**
 * 派单规则信息SaveBO
 *
 * @author yzz
 * @Date 2025-09-03 14:17:40
 */
@Data
public class DispatchRuleConfigSaveBO implements Serializable {
    @ApiModelProperty(value = " 主键 ID")
    private Long id;
    @ApiModelProperty(value = " 乐观锁版本号 ")
    private Integer revision;
    @ApiModelProperty(value = " 规则名称 ")
    private String ruleName;
    @ApiModelProperty(value = " 规则类型 ")
    private Integer type;
    @ApiModelProperty(value = " 状态（0：禁用，1：启用）")
    private Integer status;
    @ApiModelProperty(value = " 规则优先级 ")
    private Integer priority;
    @ApiModelProperty(value = " 规则匹配模式 ")
    private Integer matchMode;
    @ApiModelProperty(value = " 规则详细说明 ")
    private String ruleDesc;
    
    @ApiModelProperty("创建时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    
    @ApiModelProperty("更新时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    
    @ApiModelProperty(value = " 过滤条件列表")
    private List<DispatchRuleFilterSaveBO> filters = new ArrayList<>();

    @PostConstruct
    public void init() {
        if (this.filters == null) {
            this.filters = new ArrayList<>();
        }
    }
}